home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_08_04
/
8n04025a
< prev
next >
Wrap
Text File
|
1990-03-18
|
367b
|
30 lines
*****Listing 1*****
#include <stdio.h>
#include <errno.h>
#include <math.h>
main()
{
double d;
errno = 0;
d = sqrt(10);
if (errno == EDOM)
printf("#1 domain error\n");
else
printf("#1 OK\n");
errno = 0;
d = sqrt(-10);
if (errno == EDOM)
printf("#2 domain error\n");
else
printf("#2 OK\n");
}
#1 OK
#2 domain error